package com.company.cloud.gateway.modules.app.controller;

import java.util.Date;

import javax.servlet.http.HttpServletRequest;

import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.company.cloud.common.constant.CommonConstant;
import com.company.cloud.common.redis.service.RedisUtils;
import com.company.cloud.common.utils.HttpContextUtils;
import com.company.cloud.gateway.component.service.AuthCheckService;
import com.company.common.auth.service.SecurityUrlService;

import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.servlet.ServletUtil;

@RestController
@RequestMapping("/api")
public class ZuulTestController {

	@Autowired
	private RedisUtils redisUtils;

	@Autowired
	private RedissonClient redissonClient;

	@Autowired
	private SecurityUrlService securityUrlService;

	@GetMapping("/rlc")
	public String rlc() {
		return "ok";
	}

	@GetMapping("/p")
	public String p(@RequestParam("p") String p) {

		HttpServletRequest request = HttpContextUtils.getRequest();
		String ip= HttpContextUtils.getClientIP();
		String servletPath = request.getServletPath();
		String contextPath = request.getContextPath();
		String token = request.getHeader(CommonConstant.TOKEN_HEADER);

		

//		log.info("++++++++ servletPath={},contextPath={},token={}",servletPath,contextPath, token);
		return p;
	}

}
